{
#换源
rm -rf /etc/yum.repos.d/* 2> /dev/null
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo &> /dev/null
yum clean all && yum makecache && echo "yum 源已换好"
}
{
#部署nfs
mkdir -p /data/iso
rpm -q nfs-utils &>/dev/null || yum -y install nfs-utils &>/dev/null
systemctl enable --now rpcbind &>/dev/null
systemctl enable --now nfs &>/dev/null
echo "/data/iso *(ro,sync,all_squash)" >/etc/exports && exportfs -rv
systemctl restart rpcbind &>/dev/null
systemctl restart nfs &>/dev/null
systemctl status nfs &> /dev/null && echo "NFS 已部署"
}